package torres.map.terrain;

import java.awt.image.BufferedImage;
import torres.fileIO.ClassContainer;
import torres.view.ImageLoader;

/**
 * @author Torres
 * Represents mountain terrain, allows no ground entity to traverse.
 */
public class Mountain implements Terrain {
	
	private final int airCost;
	private final int landCost;
	private final int waterCost;
	private static final Mountain instance = new Mountain();
	private ImageLoader loader;
	private BufferedImage image;
	
	/**
	 * Creates a new default instance of Mountain. 
	 */
	private Mountain() {
		
		this.airCost = 1;
		this.landCost = Integer.MAX_VALUE;
		this.waterCost = Integer.MAX_VALUE;
		
		this.loader = new ImageLoader("mountain1.png");
		image = loader.getImage();
	}
	
	/**
	 * Returns the static Mountain terrain instance
	 * @return Mountain instance
	 */
	public static Mountain getInstance() {
		
		return instance;
	}
	
	/* (non-Javadoc)
	 * @see torres.map.terrain.Terrain#getAirCost()
	 */
	public int getAirCost() {
		
		return airCost;
	}
	
	/* (non-Javadoc)
	 * @see torres.map.terrain.Terrain#getLandCost()
	 */
	public int getLandCost() {
		
		return landCost;
	}
	
	/* (non-Javadoc)
	 * @see torres.map.terrain.Terrain#getWaterCost()
	 */
	public int getWaterCost() {
		
		return waterCost;
	}
	
	/* (non-Javadoc)
	 * @see torres.view.Displayable#getImage()
	 */
	public BufferedImage getImage() {
		
		return image;
	}
	
	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	public String toString() {
		
		return "M";
	}

	/* (non-Javadoc)
	 * @see torres.fileIO.Saveable#save()
	 */
	@Override
	public ClassContainer save() {
		ClassContainer curClass = new ClassContainer("Mountain");
		/*curClass.addProperty(new BasicContainer("airCost", airCost));
		curClass.addProperty(new BasicContainer("landCost", landCost));
		curClass.addProperty(new BasicContainer("waterCost", waterCost));*/
		
		return curClass;
	}

	/* (non-Javadoc)
	 * @see torres.fileIO.Saveable#load(torres.fileIO.ClassContainer)
	 */
	@Override
	public void load(ClassContainer classContainer) {
		// TODO Auto-generated method stub
		
	}
}
